﻿using System;
using System.Collections.ObjectModel;

namespace Wizardry
{
    /// <summary>
    /// Controls the pages and content of a Wizard
    /// </summary>
    public interface IWizardController
    {
        /// <summary>
        /// Determines whether the finish button should be displayed and is enabled.
        /// </summary>
        bool CanFinish { get; }

        /// <summary>
        /// Determines whether the wizard can navigate to the previous page.
        /// </summary>
        bool CanNavigateBackward { get; }

        /// <summary>
        /// Determines whether the wizard can navigate to the next page.
        /// </summary>
        bool CanNavigateForward { get; }

        /// <summary>
        /// Used to display the breadcrumb history.
        /// </summary>
        ObservableCollection<WizardNavigationHistoryDescriptor> NavigationHistory { get; }

        /// <summary>
        /// Gets the title of the wizard.
        /// </summary>
        string Title { get; }

        /// <summary>
        /// Performs any actions required upon finishing and closing the wizard.
        /// </summary>
        void Finish();

        /// <summary>
        /// This creates the list of pages internally.
        /// </summary>
        /// <remarks>
        /// When you wish to display the first page you must call NavigateForward.</remarks>
        void InitialisePages();

        /// <summary>
        /// Navigates to the previous page.
        /// </summary>
        /// <returns>The previous page.</returns>
        IWizardPageView NavigateBackward();

        /// <summary>
        /// Navigates to the next page.
        /// </summary>
        /// <returns>The next page.</returns>
        IWizardPageView NavigateForward();

        event EventHandler CanNavigateChanged;
    }
}
